| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkAstraeus::ComplexEffect Class Referenceabstract

Base class for all complex effects in the component. More...

Inheritance diagram for nkAstraeus::ComplexEffect:

## Public Member Functions
| ComplexEffect (COMPLEX_EFFECT_TYPE type) noexcept
virtual | ~ComplexEffect ()
nkMemory::StringView | getName () const
nkGraphics::CompositorNode * | getCompositorNode () const
COMPLEX_EFFECT_TYPE | getType () const
void | setName (nkMemory::StringView value)
void | setCompositorNode (nkGraphics::CompositorNode *value)
virtual bool | load ()=0
virtual void | unload ()=0

## Detailed Description

Base class for all complex effects in the component.

This class offers basic information and the general interface to access them. Complex effects are like Effect instances, with the difference that they require a more complex rendering logic. This can include multi-pass rendering or custom CPU logic needed before each frame.
As such, ComplexEffects are designed to be used within nkGraphics::CompositorNode instances where they will be able to append multiple operations.

## Constructor & Destructor Documentation

## ◆ ComplexEffect()

nkAstraeus::ComplexEffect::ComplexEffect | ( | COMPLEX_EFFECT_TYPE | type | ) |
| noexcept

Constructor. See ComplexEffectManager::createOrRetrieve(), or each complex effect type's create method.

Parameters

  type | The complex effect type, fed internally by the actual implementation being created.

## ◆ ~ComplexEffect()

virtual nkAstraeus::ComplexEffect::~ComplexEffect | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ getName()

nkMemory::StringView nkAstraeus::ComplexEffect::getName | ( |  | ) | const

Returns
  The name of the complex effect.

## ◆ getCompositorNode()

nkGraphics::CompositorNode* nkAstraeus::ComplexEffect::getCompositorNode | ( |  | ) | const

Returns
  The compositor node that has been associated with the effect.

## ◆ getType()

COMPLEX_EFFECT_TYPE nkAstraeus::ComplexEffect::getType | ( |  | ) | const

Returns
  The effect real type. Allows to know which derived class this effect truly is.

## ◆ setName()

void nkAstraeus::ComplexEffect::setName | ( | nkMemory::StringView | value | ) |

Sets the name of the effect.

Parameters

  value | The name to set.

Remarks
  This function is called by the EffectManager to keep it in sync with its internal memory. If you need to alter this, please call EffectManager::rename.

## ◆ setCompositorNode()

void nkAstraeus::ComplexEffect::setCompositorNode | ( | nkGraphics::CompositorNode * | value | ) |

Sets the node in which the effect should add its required rendering steps. Typically, a CompositorNode can be allocated within the Compositor where needed, and passed to the effect for it to populate it.

Parameters

  value | The node the effect has to work in.

Remarks
  Changing this after an effect has been loaded won't be taken into account until the effect is loaded again.

## ◆ load()

virtual bool nkAstraeus::ComplexEffect::load | ( |  | ) |
| pure virtual

Loads the effect and make it ready for rendering. After a successful call, this means the compositor node will be populated with the relevant data.

Returns
  Whether the loading went well (true) or not (false).

Implemented in nkAstraeus::DofComplexEffect, and nkAstraeus::BlurComplexEffect.

## ◆ unload()

virtual void nkAstraeus::ComplexEffect::unload | ( |  | ) |
| pure virtual

Unloads the effect and its internal memory. After that, the effect is unusable for rendering. The compositor node specified will be cleaned from all linked operations.

Implemented in nkAstraeus::DofComplexEffect, and nkAstraeus::BlurComplexEffect.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsAstraeus/Graphics/ComplexEffects/ComplexEffect.h